<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title><script src="../js/jquery-3.3.1.min.js"></script>
    <script>
        $(document).ready(function () {
            $("#testAjax").click(function () {
                //通过ajax请求springmvc
                $.post("http://localhost/springmvcproject1/Ajax",function (data) {/*需要注意，如果这里是jsp可直接写服务器名，当为html时写全服务器名*/
                    for (var i=0;i<data.length;i++){
                        alert(data[i].sno)
                    }
                    }
                );
            });
        })
    </script>
</head>
<body>
<input id="testAjax" type="button" value="Ajax">
</body>
</html>